import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import Components from 'unplugin-vue-components/vite';
import { NutUIResolver } from '@nutui/auto-import-resolver';
import vueDevTools from 'vite-plugin-vue-devtools';

// https://vitejs.dev/config/
export default defineConfig({
  server: {
    allowedHosts: true,
  },
  plugins: [
    vue(),
    vueDevTools(),
    Components({
      resolvers: [
        NutUIResolver({ taro: true })
      ],
      dts: 'src/components.d.ts', // 根据你的项目结构调整路径
    }),
  ],
  define: {
    __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false'
  }
});